import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Vant from 'vant';
import 'vant/lib/index.css';
import '@/assets/iconfont/iconfont.css'
import Tabbar from '@/components/Tabbar'
import BackBtn from '@/components/BackBtn'
// 路由守卫
import './router/permision';
// 位置信息
import { VueJsonp } from 'vue-jsonp'
Vue.prototype.$jsonp = VueJsonp
Vue.use(VueJsonp)

Vue.use(Vant);

// 将tabber注册为全局组件
Vue.component(Tabbar.name, Tabbar);
// 将返回按钮注册为全局组件
Vue.component(BackBtn.name, BackBtn);

Vue.config.productionTip = false

let userInfo = localStorage.getItem('userInfo');
if (userInfo) {
  let obj = JSON.parse(userInfo);
  store.commit('login/setUserInfo', obj);
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
